package nowCoder;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by Ghost on 2015/1/30 0030.
 */
public class FindAIequalsI {
    List<Integer> rst = new LinkedList<Integer>();
    public void search(int[] A,int start, int end){
        if(start>=end){
            return;
        }

        int mid = (start+end)>>1;
        if(A[mid]==mid){
            rst.add(mid);
            search(A,mid+1,end);
            search(A,start,mid);
        }
         else if(A[mid]<mid){
            search(A,mid+1,end);
        }
        else
            search(A,start,mid);
    }

    public static void main(String[] args){
        FindAIequalsI findAIequalsI = new FindAIequalsI();
        int[] A = {0,1};
        findAIequalsI.search(A,0,A.length);
        System.out.println(findAIequalsI.rst);
    }

}
